
<!DOCTYPE >
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <title>商品列表</title>
    <meta name="keywords" content="商品列表-虎居农产品.餐饮.本地生活外卖极速达">
    <meta name="description" content="商品列表-虎居农产品.餐饮.本地生活外卖极速达">
    <link th:href="@{/css/list.css}" rel="stylesheet" 0="app\assets\AppAsset">
    <link th:href="@{/css/iconfont.css}" rel="stylesheet" 0="app\assets\AppAsset">
    <link th:href="@{/css/site-base.css}" rel="stylesheet" 0="app\assets\AppAsset">
    <link th:href="@{/css/main.css}" rel="stylesheet" 0="app\assets\AppAsset">
    <link th:href="@{/css/process.css}" rel="stylesheet" 0="app\assets\AppAsset"><link rel="shortcut icon" href="/shop_pc/images/favicon.ico">
    <script language="JavaScript" th:src="@{/js/jquery-1.10.2.min.js}"></script>
    <script language="JavaScript" th:src="@{/js/superslide.js}"></script>
    <script language="JavaScript" th:src="@{/js/scroll_city.js}"></script>
    <script language="JavaScript" th:src="@{/js/main.js}"></script>
    <script language="JavaScript" th:src="@{/js/layer.js}"></script>
    <script language="JavaScript" th:src="@{/js/wow.min.js}"></script>
    <script language="JavaScript" th:src="@{/js/template.js}"></script>
    <script language="JavaScript" th:src="@{/js/jquery.cookie.js}"></script>
    <script type="text/javascript" th:src="@{/js/function.js}"></script>
</head>
<body>
<!--header-->
<div class="header">
    <div class="w1180">
        <ul class="fl">
            <li>
                <a href="/">虎居首页</a>
            </li>
            <li class="hoverClick site-up top-site-up">
            </li>
            <li class="hoverClick">
                <a class="app-down">
                    <i class="iconfont">&#xe602;</i>
                    手机虎居
                </a>
                <div class="app-up hoverOpen">
                    <img alt="虎居网 下载虎居APP-外卖极速达平台" th:src="@{/picture/app.png}"/>
                </div>
            </li>
            <li class="hoverClick">
                <a class="app-down">
                    <i class="iconfont wx">&#xe603;</i>
                    微信公众号
                </a>
                <div class="app-up hoverOpen">
                    <img alt="虎居网 微信公众号-外卖极速达平台" th:src="@{/picture/vipcn.jpg}" />
                </div>
            </li>
            <li>
                <a>
                    全国热线：
                    <b class="org">
                        400-9028-521
                    </b>
                </a>
            </li>
        </ul>
        <ul class="fr">
            <li>
                <span style="color: #fc7e31;" th:text="${session.user!=null?'亲，'+session.user.getEuUserName()+'欢迎回来！':'请先登录'}"></span>
            </li>


            <li th:if="${session.user==null}">
                <a th:href="@{/user/tologin}" rel="nofollow">
                    登录
                </a>
            </li>
            <li th:if="${session.user!=null}">
                <a th:href="@{/user/tologin}" rel="nofollow">
                    切换账号
                </a>
            </li>
            <li>
                <a th:href="@{/user/to_reg}" rel="nofollow">
                    注册
                </a>
            </li>
            <li>
                <a th:href="@{/cart/tocart}" target="_blank" rel="nofollow">
                    <i class="cart_icon"></i>
                    购物车
                    <span th:if="${session.car==null}" class="org"th:text="'(0)件'"></span>
                    <span th:if="${session.car!=null}" class="org"th:text="${'('+session.car.size()+')'}"></span>件

                </a>
            </li>
            <li class="hoverClick">
                <a class="border" target="_blank" title="我的虎居" href="/member" rel="nofollow">
                    我的虎居
                    <i class="iconfont up">&#xe608;</i>
                </a>
                <div class="serve-up hoverOpen">
                    <ul>
                        <li>
                            <a target="_blank" title="待付款订单" href="/myorder/pending-payment" rel="nofollow">待付款订单</a>
                        </li>
                        <li>
                            <a target="_blank" title="我的优惠券" href="/wallet/coupon" rel="nofollow">我的优惠券</a>
                        </li>
                        <li>
                            <a target="_blank" title="我的关注" href="/follow/goods" rel="nofollow">我的关注</a>
                        </li>
                    </ul>
                </div>
            </li>
            <li>
                <a target="_blank" title="商家登录" class="border" href="https://seller.huju168.com" rel="nofollow">
                    商家登录
                </a>
            </li>
            <li class="hoverClick">
                <a class="border" target="_blank" title="关于我们" rel="nofollow" href="/help-1264-1.html">
                    关于我们
                    <i class="iconfont up">&#xe608;</i>
                </a>
                <div class="serve-up hoverOpen">
                    <ul>
                        <li>
                            <a  target="_blank" title="关于我们" rel="nofollow" href="/help-1264-1.html">关于我们</a>
                        </li>
                    </ul>
                </div>
            </li>
        </ul>
    </div>
</div>

<!-- logo-search -->
<div class="logo-search">
    <h1 class="logo">
        <a title="外卖新鲜极速送—上虎居网上商城" href="/">
            <img alt="外卖新鲜极速送—上虎居网上商城" th:src="@{/picture/logo.png}" />
        </a>
        <!--<span class="title" title="购买新鲜-上虎居网上商城直卖网">
            <img alt="购买新鲜-上虎居网上商城直卖网" th:src="@{/picture/log-til.png" />
        </span>-->
    </h1>
    <div class="search-main">
        <!--	搜索框-->
        <div class="search-box" th:include="search::search-frm"></div>
        <script type="text/javascript">
            $(document).on('keyup', '.search-box', function(event) {
                if(event.keyCode == 13) {
                    $('#search-goods').trigger('click');
                }
            });

            function size(obj){
                obj.classList.add("org");
            }

            function size1(obj){
                obj.classList.remove("org");
            }

            /**
             * @return mixed
             * */
            function searchFun()
            {
                var search = $('#search-value').val() ? '-'+$('#search-value').val() : '';

                if(isRealNum($('#search-value').val())){
                    window.location.href = "/goods" + search+".html";
                }else{
                    window.location.href = "/search" + search+".html";
                }

            }



            function isRealNum(val){
                if(val === "" || val ==null){
                    return false;
                }
                if(!isNaN(val)){
                    return true;
                }else{
                    return false;
                }
            }
        </script>
        <div class="search-hot">
        </div>
    </div>
    <div class="shopCart hoverClick">
        <div class="hoverOpen">
            <div class="settleup-content">
                <div class="mc">
                    <ul>
                        <li>
                            <div class="p-img">
                                <a target="_blank">
                                    <img th:src="@{/picture/tiyandian.jpg}" width="50" height="50">
                                </a>
                            </div>
                            <div class="p-name">
                                <a target="_blank" title="test3">test3</a>
                            </div>
                            <div class="p-number">
                                <span class="num">1</span>
                                <div class="count">
                                    <a class="count-add"><i class="iconfont icon-up">&and;</i></a>
                                    <a class="count-remove"><i class="iconfont icon-down">&or;</i></a>
                                </div>
                            </div>
                            <div class="p-oper">
                                <div class="price"><em>¥</em>0.01</div>
                                <a class="remove">删除</a>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="mb">
                    <input name="cart_value" type="hidden">
                    <div class="p-total">共1件商品&nbsp;&nbsp;共计：0.01</div>
                    <a th:href="@{/cart/tocart}" target="_blank" class="btn-cart">去购物车</a>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="nav-main-box">
    <div class="nav-box">
        <div class="pull-nav">
            <a class="pull-a">
                <i></i>商品分类
            </a>
            <div class="pull-box" th:include="category::category-box">
            </div>

        </div>
        <div class="menu-nav">
            <ul>
                <li>
                    <a th:href="@{/index/index}" target="_blank" title="首页">首页</a>
                </li>
                <li>
                    <a target="_blank" title="家具馆" th:href="@{/furniture/list}">家具馆</a>
                </li>
                <li>
<!--                    <a target="_blank" title="建材馆" th:href="@{/material/list}">建材馆</a>-->
                </li>
                <li>
                    <a target="_blank" title="体验店" th:href="@{/experience/list}">体验店</a>
                </li>
                <li>
                    <a target="_blank" title="精品细粮" href="http://admin.huju168.com/main/index">精品细粮</a>
                </li>

            </ul>
        </div>
        <div class="clearfix"></div>
    </div>
</div>
<!--<script language="javascript" th:src="@{/js/lsjs.js}"></script>-->
<script type="text/javascript">
    var siteThreeClassArr = [];
    var siteClassBrandArr = [];

    $(function () {
        childClassInfoFun();

        $(document).on('mouseenter', '.pull-box-li', function() {
            var _this = $(this);
            var cateId = _this.attr('cate-id');
            if(cateId) {
                $.ajax({
                    url: '/goods/get-class-by-id',
                    type: 'post',
                    data: {
                        cateId: cateId
                    },
                    dataType: 'json',
                    success: function(json) {
                        if(json['cache'] && json['cache'] == 1 && json['ret'] == 200) {
                            _this.find('.pull-down').html(json['data']);
                        } else {
                            siteClassStyleFun(json['data'], _this);
                        }
                    },
                    error: function(reg) {
                        console.log(reg);
                    }
                });
            }
        });
    });

    /**
     * 直接获取分类下面的子分类
     * */
    function childClassInfoFun()
    {
        var cateIds = '';
        $.each($('.pull-box-li'), function(i, obj) {
            var _this = $(this);
            var cateId = _this.attr('cate-id');
            if(cateId) {
                cateIds += cateId+',';
            }
        });

        var ids = cateIds.substring(0, cateIds.length - 1);// 截取开始到长度减-1的字符串，去掉逗号
        $.ajax({
            url: '/site/child-class-info',
            type: 'post',
            data: {
                cateId: ids,
                _csrf: '0X16hkqCLihdUGz6qAsH4Bie-7si6zXFXhySJiwA-bijSzzMDOcZUGgDBYjYanTSbfu98mibW5IobMtjW1Ws4Q=='
            },
            dataType: 'json',
            success: function(json) {},
            error: function(reg) {}
        });
    }

    /**
     * 赋予分类数据
     * */
    function siteClassStyleFun(data, me)
    {
        var html = '';

        $.each(data, function(i, obj) {
            if(i > 4) {
                return false;
            }

            var info2 = {};

            info2['cate_id'] = obj['cate_id'];
            info2['cate_name'] = obj['cate_name'];
            siteClassBrandArr[i] = info2;

            if(obj['sons'] && obj['sons'].length>0) {
                html += '<div class="classify-for">';
                var data = [];
                var tips = 0;
                $.each(obj['sons'], function(x, cla) {
                    html += '<dl>';
                    html += '   <dt><a target="_blank" title="'+cla['cate_name']+'" href="/category-'+cla['cate_code_id']+'">'+cla['cate_name']+'</a></dt>';
                    html += '   <dd>';

                    if(cla['sons'].length>0) {
                        $.each(cla['sons'], function(z, _cla) {
                            var org = '';
                            if(_cla['cate_is_highlight'] == 1) {
                                org = 'class="org"';
                            }
                            html += '<a target="_blank" title="'+_cla['cate_name']+'" '+org+' href="/category-'+_cla['cate_code_id']+'-'+_cla['cate_leve']+'">'+_cla['cate_name']+'</a>';
                        });
                    } else {
                        html += '&nbsp;';
                    }

                    html += '   </dd>';
                    html += '</dl>';
                });
                html += '</div>';

                html += '<div class="recomBrand recomBrand-'+i+'">';
                html += '   <dl class="brand">';
                html += '   </dl>';
                html += '   <dl class="activity">';
                html += '   </dl>';
                html += '</div>';
            }
        });

        me.find('.pull-down').html(html);
        giveSiteClassBrandFun();
        giveSiteClassAdFun();
    }

    /**
     * 分类下面的品牌
     * */
    function giveSiteClassBrandFun()
    {
        $.each(siteClassBrandArr, function(i, obj) {
            if(obj['cate_id']) {
                $.ajax({
                    url: '/site/ajax-class-brand',
                    type: 'post',
                    data: {
                        cateId: obj['cate_id'],
                        _csrf: '0X16hkqCLihdUGz6qAsH4Bie-7si6zXFXhySJiwA-bijSzzMDOcZUGgDBYjYanTSbfu98mibW5IobMtjW1Ws4Q=='
                    },
                    dataType: 'json',
                    success: function(json) {
                        if(json['ret'] == 200) {
                            var html = '';
                            if(json['data'] && json['data'].length>0) {
                                html += '   <dt>推荐品牌</dt>';
                                $.each(json['data'], function(z, _obj) {
                                    var logo = '/shop_pc/images/img/tiyandian.jpg';
                                    if(_obj['brand_logo']) {
                                        logo = _obj['brand_logo'];
                                    }

                                    var brandName = '';
                                    if(_obj['brand_name']) {
                                        brandName = _obj['brand_name'];
                                    }

                                    if(z < 6) {
                                        html += '<dd><a target="_blank" title="brandName" href="/search-'+brandName+'.html"><img alt="'+brandName+'" src="'+logo+'?imageView2/1/w/100/h/44/q/100/" /></a></dd>';
                                    }

                                });
                                $('.recomBrand-'+i).find('.brand').html(html);
                            }

                        } else {
                            //layer.msg(json['msg']);
                        }
                    },
                    error: function(reg) {
                        console.log(reg);
                    }
                });
            }
        });
    }

    /**
     * 分类下面的广告
     * */
    function giveSiteClassAdFun()
    {
        $.each(siteClassBrandArr, function(i, obj) {
            if(obj['cate_id']) {
                var code = '';
                var cateId = obj['cate_id'];

                // 正式
                if(cateId == '4cef7c957d5a4d89926f97fb25e3a9d2') {
                    code = '10134';
                } else if(cateId == 'f87eae197057402f9fa4afa41e4907c0') {
                    code = '10135';
                } else if(cateId == '8f4927268851460a97781ad031822b66') {
                    code = '10136';
                } else if(cateId == '29938d6509ea43a8acc1849b5326a942') {
                    code = '10137';
                } else if(cateId == '1f276fee4d1742d6a55833317275e56b') {
                    code = '10138';
                }

                $.ajax({
                    url: '/site/ajax-class-ad',
                    type: 'post',
                    async: false,
                    data: {
                        code: code,
                        _csrf: '0X16hkqCLihdUGz6qAsH4Bie-7si6zXFXhySJiwA-bijSzzMDOcZUGgDBYjYanTSbfu98mibW5IobMtjW1Ws4Q=='
                    },
                    dataType: 'json',
                    success: function(json) {
                        if(json['ret'] == 200) {
                            var html = '';
                            if(json['data']) {
                                html += '   <dt>精选活动</dt>';
                                html += '   <dd><a target="_blank" title="'+json['data']['position']['advertisingList'][0]['materialList'][0]['name']+'" href="'+json['data']['position']['advertisingList'][0]['materialList'][0]['href']+'"><img alt="'+json['data']['position']['advertisingList'][0]['materialList'][0]['name']+'" src="'+json['data']['position']['advertisingList'][0]['materialList'][0]['file_key']+'?imageView2/1/w/220/h/120/q/100/"></a></dd>';
                                $('.recomBrand-'+i).find('.activity').html(html);
                            }

                        } else {
                            //layer.msg(json['msg']);
                        }
                    },
                    error: function(reg) {
                        console.log(reg);
                    }
                });
            }
        });
    }
</script>
<div class="bread_crumbs">
    <div class="w1190">
        <div class="label fl">
            <a class="fl" href="/">首页</a>
            <i class="iconfont fl">&#xe605;</i>
        </div>
    </div>
</div>


<!--搜索无结果-->
<div th:if="${productPage.getTotal() == 0}" class="fruitless_box" style="margin-bottom: 20px;">
    <i class="iconfont">&#xe622;</i>
    <span>很抱歉，没有找到符合条件的商品</span>
</div>

<div class="goods_list_content" th:if="${productPage.getTotal() != 0}">
    <div class="goods_list">
        <ul>
            <li th:each="pro :  ${productPage.getRecords()}">
                <div class="slide_img">
                    <div class="img_max">
                        <ul>
                            <li>

                                <a target="_blank" th:title="${pro.epName}"
                                   th:href="@{/goods/detail(pid=${pro.epId})}">
                                    <img alt="测试-北欧风情  实木椅家用现代简约餐厅餐桌椅书桌椅休闲凳子北欧靠背书椅"
                                         th:src="@{'/picture/'+${pro.epFileName}}"/>
                                </a>
                            </li>
                        </ul>
                    </div>

                </div>
                <div class="price_box">
                    <span class="price"> <span th:text="${'￥'+pro.epPrice }"></span></span>
                </div>
                <p class="name_box">
                    <a target="_blank" th:text="${pro.epName}" title="测试-北欧风情  实木椅家用现代简约餐厅餐桌椅书桌椅休闲凳子北欧靠背书椅"
                       th:href="@{/goods/detail(pid=${pro.epId})}">
                        测试-北欧风情 实木椅家用现代简约餐厅餐桌椅书桌椅休闲凳子北欧靠背书椅 </a>
                </p>
                <p class="evaluate_box" th:text="${'剩余库存:'+pro.epStock +';##描述##:'+pro.epDescription}">
                </p>
                <p class="shop_kefu">
                    <a target="_blank" title="虎居自营" th:href="@{/index/index}"><span>虎居自营</span></a>
                </p>
            </li>
        </ul>
    </div>

    <div class="goods_page tr"><span class="tc" th:text="'共有'+${productPage.getTotal()+'条记录'}"></span>
        <a class="prev"
           th:disabled="${productPage.getCurrent() == 1?'true':'false'}"
           th:href="@{/product/search(pnum = ${productPage.getCurrent()-1},keyword = ${keyword})}"
           style="margin: 0 2px;"><i class="iconfont">&#xe607;</i>上一页</a>

        <a class="active"
           th:class="${num == productPage.getCurrent()?'current':''}"
           th:each="num : ${#numbers.sequence(1,productPage.getPages())}"
           th:href="@{/product/search(pnum = ${num},keyword = ${keyword})}" th:text="${num}"
           style="margin: 0 2px;">1</a>

        <a class="next"
           th:disabled="${productPage.getCurrent() == 1?'true':'false'}"
           th:href="@{/product/search(pnum = ${productPage.getCurrent()+1},keyword = ${keyword})}"
           style="margin: 0 2px;">下一页<i class="iconfont">&#xe605;</i></a>
    </div>
</div>

<script>
    (function(){
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        }
        else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

<script type="text/javascript">
    var likeIndex = '1';
    $(function(){
        anotherBatchFun();
        bottomBannerAdFun();

        // 移除品牌
        $(document).on('click', '.brand-attr-remove', function() {
            var _this = $(this);
            var valName = _this.attr('val-name');
            var attrId = '';
            var brandAttrId = _this.attr('brand-attr-id');
            var url = '';

            var ids = '';
            var names = '';

            for(var key in attrData) {
                var attrVal = attrData[key];
                for(var k in attrVal) {
                    var attrValId = attrVal[k]['val_id'];
                    var attrActive = attrVal[k]['active'];
                    var attrValName = attrVal[k]['val_name'];
                    if(attrActive == 1) {
                        ids += attrValId + '-';
                        names += attrValName + ',';
                    }
                }
            }

            var brandIds = '';
            var brandNames = '';
            $.each($('.goods-brand'), function(i, obj) {
                var _the = $(this);

                if(_the.parents('li').hasClass('active') && $.trim(_the.find('.txt').text()) != valName) {
                    var brandId = _the.attr('brand-attr-id');
                    var brandName = _the.find('.txt').text() ? $.trim(_the.find('.txt').text()) : '';
                    brandIds += brandId + '-';
                    brandNames += brandName + ',';
                }
            });

            var id2 = '';
            if(brandIds) {
                id2 = brandIds.substring(0, brandIds.length - 1);// 截取开始到长度减-1的字符串，去掉逗号
            }

            if(ids) {
                if(brandIds) {
                    url = "/category-14606176-/"+attrId+"/"+id2+"?attrName="+names+"&brandName="+brandNames;
                } else {
                    url = "/category-14606176-/"+attrId+"/?attrName="+names;
                }

            } else {
                if(brandIds) {
                    url = "/category-14606176-/"+id2+"?brandName="+brandNames;
                } else {
                    url = "/category-14606176-";
                }
            }

            window.location.href=url;
        });

        // 移除属性
        $(document).on('click', '.goods-attr-remove', function() {
            var _this = $(this);
            var valName = _this.attr('val-name');

            var ids = '';
            var names = '';

            var id = '';
            var name = '';
            for(var key in attrData) {
                var attrVal = attrData[key];
                for(var k in attrVal) {
                    var attrValId = attrVal[k]['val_id'];
                    var attrActive = attrVal[k]['active'];
                    var attrValName = attrVal[k]['val_name'];
                    if(attrActive == 1 && attrValName != valName) {
                        ids += attrValId + '-';
                        names += attrValName + ',';
                    }
                }
            }

            var brandIds = '';
            var brandNames = '';
            $.each($('.goods-brand'), function(i, obj) {
                var _the = $(this);
                if(_the.parents('li').hasClass('active')) {
                    var brandId = _the.attr('brand-attr-id');
                    var brandName = _the.find('.txt').text() ? $.trim(_the.find('.txt').text()) : '';
                    brandIds += brandId + '-';
                    brandNames += brandName + ',';
                }
            });

            var url = '';
            if(ids) {
                id = ids.substring(0, ids.length - 1);// 截取开始到长度减-1的字符串，去掉逗号
            }

            var id2 = '';
            if(brandIds) {
                id2 = brandIds.substring(0, brandIds.length - 1);// 截取开始到长度减-1的字符串，去掉逗号
            }

            if(ids) {
                if(brandIds) {
                    url = "/category-14606176-/"+id+"/"+id2+"?attrName="+names+"&brandName="+brandNames;
                } else {
                    url = "/category-14606176-/"+id+"/?attrName="+names;
                }

            } else {
                if(brandIds) {
                    url = "/category-14606176-/"+id2+"?brandName="+brandNames;
                } else {
                    url = "/category-14606176-";
                }
            }

            window.location.href=url;
        });

        // 选择品牌
        $(document).on('click', '.goods-brand', function() {
            var _this = $(this);
            if(_this.parents('li').hasClass('active')) {
                _this.parents('li').removeClass('active');
            } else {
                _this.parents('li').addClass('active');
            }
            var valName = _this.find('.txt').text() ? $.trim(_this.find('.txt').text()) : '';
            var attrId = '';
            var brandAttrId = _this.attr('brand-attr-id');
            var url = '';

            var ids = '';
            var names = '';

            for(var key in attrData) {
                var attrVal = attrData[key];
                for(var k in attrVal) {
                    var attrValId = attrVal[k]['val_id'];
                    var attrActive = attrVal[k]['active'];
                    var attrValName = attrVal[k]['val_name'];
                    if(attrActive == 1) {
                        ids += attrValId + '-';
                        names += attrValName + ',';
                    }
                }
            }

            var brandIds = '';
            var brandNames = '';
            $.each($('.goods-brand'), function(i, obj) {
                var _the = $(this);
                if($.trim(_the.attr('brand-attr-id')) == brandAttrId) {
                    var brandId = _the.attr('brand-attr-id');
                    var brandName = _the.find('.txt').text() ? $.trim(_the.find('.txt').text()) : '';
                    brandIds = brandId + '-';
                    brandNames = brandName + ',';
                }
            });

            var id2 = '';
            if(brandIds) {
                id2 = brandIds.substring(0, brandIds.length - 1);// 截取开始到长度减-1的字符串，去掉逗号
            }

            if(attrId) {
                if(brandIds) {
                    url = "/category-14606176-/"+attrId+"/"+id2+"?attrName="+names+"&brandName="+brandNames;
                } else {
                    url = "/category-14606176-/"+attrId+"/?attrName="+names;
                }

            } else {
                if(brandIds) {
                    url = "/category-14606176-/"+id2+"?brandName="+brandNames;
                } else {
                    url = "/category-14606176-";
                }
            }

            window.location.href=url;
        });

        // 选择属性
        $(document).on('click', '.goods-attr', function() {
            var _this = $(this);
            var valId = _this.attr('val-id');
            var propId = _this.attr('prop-id');

            var ids = '';
            var names = '';
            if(valId == '') {
                ids = '';
            }

            var id = '';
            for(var key in attrData) {
                var attrVal = attrData[key];
                if(propId == key) {
                    for(var k in attrVal) {
                        var attrValId = attrVal[k]['val_id'];
                        if(attrValId == valId) {
                            attrVal[k]['active'] = '1';
                        } else {
                            attrVal[k]['active'] = '';
                        }
                    }
                }
            }

            for(var key in attrData) {
                var attrVal = attrData[key];
                for(var k in attrVal) {
                    var attrValId = attrVal[k]['val_id'];
                    var attrActive = attrVal[k]['active'];
                    var attrValName = attrVal[k]['val_name'];
                    if(attrActive == 1) {
                        ids += attrValId + '-';
                        names += attrValName + ',';
                    }
                }
            }

            var brandIds = '';
            var brandNames = '';
            $.each($('.goods-brand'), function(i, obj) {
                var _the = $(this);
                if(_the.parents('li').hasClass('active')) {
                    var brandId = _the.attr('brand-attr-id');
                    var brandName = _the.find('.txt').text() ? $.trim(_the.find('.txt').text()) : '';
                    brandIds += brandId + '-';
                    brandNames += brandName + ',';
                }
            });

            var url = '';
            if(ids) {
                id = ids.substring(0, ids.length - 1);// 截取开始到长度减-1的字符串，去掉逗号
            }

            var id2 = '';
            if(brandIds) {
                id2 = brandIds.substring(0, brandIds.length - 1);// 截取开始到长度减-1的字符串，去掉逗号
            }

            if(ids) {
                if(brandIds) {
                    url = "/category-14606176-/"+id+"/"+id2+"?attrName="+names+"&brandName="+brandNames;
                } else {
                    url = "/category-14606176-/"+id+"/?attrName="+names;
                }

            } else {
                if(brandIds) {
                    url = "/category-14606176-/"+id2+"?brandName="+brandNames;
                } else {
                    url = "/category-14606176-";
                }
            }

//            if(brandIds) {
//                url = "/category-//-///"+id+"///?attrName="+names+"&brandName="+brandNames;
//            } else {
//                url = "/category-//-///"+id+"///?attrName="+names;
//            }
            window.location.href=url;
        });

        // 排序
        $(document).on('click', '.filter-sort a', function() {
            var _this = $(this);
            var sortType = _this.attr('sort-type');
            var orderByType = _this.attr('order-by-type');

            var url = '/category-14606176';

            url = replaceUrlFun(url, '?sortType', /\?sortType=(\w*)/ig, '?sortType='+sortType, '&sortType', /\&sortType=(\w*)/ig, '&sortType='+sortType, sortType);
            url = replaceUrlFun(url, '?orderByType', /\?orderByType=(\w*)/ig, '?orderByType='+orderByType, '&orderByType', /\&orderByType=(\w*)/ig, '&orderByType='+orderByType, orderByType);

            window.location.href = url;
        });
    });

    /**
     * 换一批
     * */
    function anotherBatchFun()
    {
        $.ajax({
            url: '/goods/guess-you-like',
            type: 'post',
            data: {
                showType: '1',
                page: likeIndex,
                _csrf: '0X16hkqCLihdUGz6qAsH4Bie-7si6zXFXhySJiwA-bijSzzMDOcZUGgDBYjYanTSbfu98mibW5IobMtjW1Ws4Q=='
            },
            dataType: 'json',
            beforeSend: function(ret) {
                $('.goods_list2').addClass('loading-icon').html('');
            },
            complete: function(ret) {
                $('.goods_list2').removeClass('loading-icon');
            },
            success: function(json) {
                if(json['ret'] == 200) {
                    if(json['data']['rows'] && json['data']['rows'].length>0) {
                        if(likeIndex >= json['data']['last_page']) {
                            likeIndex = '1';
                        } else {
                            likeIndex = parseInt(json['data']['current_page']) + 1;
                        }

                        guessYouLikeFun(json['data']['rows']);
                    }
                } else {
                    $('.goods_list2').html('<div class="not_data"><i></i><p>暂无数据</p></div>');
                }
            },
            error: function(reg) {
                console.log(reg);
            }
        });
    }

    /**
     * 底部通栏广告
     * */
    function bottomBannerAdFun()
    {
        $.ajax({
            url: '/site/ajax-banner-ad',
            type: 'post',
            data: {
                code: '10139',
                _csrf: '0X16hkqCLihdUGz6qAsH4Bie-7si6zXFXhySJiwA-bijSzzMDOcZUGgDBYjYanTSbfu98mibW5IobMtjW1Ws4Q=='
            },
            dataType: 'json',
            success: function(json) {
                if(json['ret'] == 200) {
                    if(json['data']) {
                        var img = '/shop_pc/images/img/tiyandian.jpg';
                        if(json['data']['position']['advertisingList'][0]['materialList'][0] && json['data']['position']['advertisingList'][0]['materialList'][0]['file_key'] && json['data']['position']['advertisingList'][0]['materialList'][0]['file_key']!='') {
                            $('.goods-ad').html('<a target="_blank" title="'+json['data']['position']['advertisingList'][0]['materialList'][0]['name']+'" href="'+json['data']['position']['advertisingList'][0]['materialList'][0]['href']+'"><img alt="'+json['data']['position']['advertisingList'][0]['materialList'][0]['name']+'" class="lazy" src="'+json['data']['position']['advertisingList'][0]['materialList'][0]['file_key']+'"></a>');
                        }
                    }
                } else {
                    $('.goods-ad').remove();
                }
            },
            error: function(reg) {
                $('.goods-ad').remove();
                console.log(reg);
            }
        });
    }

    /**
     * 猜你喜欢-结构
     * */
    function guessYouLikeFun(data)
    {
        var tpl = document.getElementById('guessYouLikeTmp').innerHTML;
        var html = template(tpl, {data: data});
        $('.goods_list2').html(html);

        //大图切换
        $(".slide_img").slide({
            titCell:".img_min li",
            mainCell:".img_max ul",
            effect:"fade",
            autoPlay:false,
            delayTime:200
        });
        //小图左滚动切换
        $(".slide_img .img_min").slide({
            mainCell:"ul",
            delayTime:100,
            vis:5,
            effect:"left",
            autoPage:true,
            prevCell:".sPrev",
            nextCell:".sNext"
        });
    }
</script>
<!-- footer -->
<div class="footer">
    <div class="footer-new-top">
        <div class="w1180">
            <ul class="service-list">
                <li>
                    <i class="icon-1"></i>
                    <strong>权威可信</strong>
                    <p>商家经过严格实名认证</p>
                </li>
                <li>
                    <i class="icon-2"></i>
                    <strong>就近购买</strong>
                    <p>优先展示附近商家</p>
                </li>
                <li>
                    <i class="icon-3"></i>
                    <strong>线下体验</strong>
                    <p>全国数十万家体验店</p>
                </li>
                <li>
                    <i class="icon-4"></i>
                    <strong>商品直卖</strong>
                    <p>厂家直卖用户无中间商</p>
                </li>
            </ul>
        </div>
    </div>
    <div class="footer-new-con">
        <div class="w1180">
            <div class="help-list">
                <div class="tel">
                    <em>全国客服热线</em>
                    <strong>400-9028-521</strong>
                    <!--<span>028-67100877</span>
                    <p>
                        周一至周日 0:00-24:00<br>
                        免费咨询(咨询、建议、投诉)
                    </p>-->
                </div>
                <dl>
                    <dt>新手指南</dt>
                    <dd><a target="_blank" rel="nofollow" title="隐私保护" href="/help-1513-1.html">隐私保护</a></dd>
                    <dd><a target="_blank" rel="nofollow" title="注册引导" href="/help-1017-1.html">注册引导</a></dd>
                    <dd><a target="_blank" rel="nofollow" title="购物流程" href="/help-6512-1.html">购物流程</a></dd>
                    <dd><a target="_blank" rel="nofollow" title="常见问题" href="/help-3845-1.html">常见问题</a></dd>
                </dl>
                <dl>
                    <dt>关于我们</dt>
                    <dd><a target="_blank" rel="nofollow" title="发展历程" href="/help-4441-1.html">发展历程</a></dd>
                    <dd><a target="_blank" rel="nofollow" title="虎居招聘" href="/help-8791-1.html">虎居招聘</a></dd>
                    <dd><a target="_blank" rel="nofollow" title="联系我们" href="/help-4206-1.html">联系我们</a></dd>
                    <dd><a target="_blank" rel="nofollow" title="平台简介" href="/help-1264-1.html">平台简介</a></dd>
                </dl>
                <dl>
                    <dt>服务保障</dt>
                    <dd><a target="_blank" rel="nofollow" title="正品保障" href="/help-4356-1.html">正品保障</a></dd>
                    <dd><a target="_blank" rel="nofollow" title="7天无理由退换货" href="/help-4438-1.html">7天无理由退换货</a></dd>
                    <dd><a target="_blank" rel="nofollow" title="退货退款" href="/help-4434-1.html">退货退款</a></dd>
                    <dd><a target="_blank" rel="nofollow" title="纠纷处理" href="/help-1257-1.html">纠纷处理</a></dd>
                </dl>
                <dl>
                    <dt>加入我们</dt>
                    <dd><a target="_blank" rel="nofollow" title="操作引导" href="/help-4448-1.html">操作引导</a></dd>
                    <dd><a target="_blank" rel="nofollow" title="农业资讯" href="https://www.huju168.com/zixun">农业资讯</a></dd>
                    <dd><a target="_blank" rel="nofollow" title="登录入口" href="/help-1276-1.html">登录入口</a></dd>
                </dl>

                <div class="qr-code">
                    <div class="code_img">
                        <img alt="虎居网 关注微信公众号-外卖极速达平台" th:src="@{/picture/vipcn.jpg}" />
                        <p>关注微信公众号</p>
                    </div>
                    <div class="qr-item">
                        <img alt="虎居网 下载虎居APP-外卖极速达平台" th:src="@{/picture/app.png}" />
                        <p>下载虎居APP</p>
                    </div>
                </div>
            </div>

            <div class="copyright_links">
                <a target="_blank" href="/register-info.html">
                    注册协议
                </a>
                <span class="spacer"></span>
                <a class="p-kefu" onclick="openZoosUrl('chatwin');">
                    联系客服
                </a>
                <!--<span class="spacer"></span>
                <a target="_blank" title="友情链接" href="/link.html">
                    友情链接
                </a>-->
                <span class="spacer"></span>
                <a target="_blank" title="全部分类" href="/class.html">
                    全部分类
                </a>
                <!--<span class="spacer"></span>
                <a>
                    广告合作
                </a>
                <span class="spacer"></span>
                <a target="_blank" title="商家中心" href="https://seller.huju168.com">
                    商家中心
                </a>-->
                <span class="spacer"></span>
                <a target="_blank" title="站点地图" href="/map.html">
                    站点地图
                </a>
                <span class="spacer"></span>
                <a rel="nofollow" target="_blank" title="APP下载" href="/download">
                    APP下载
                </a>
                <a style="display: none;" target="_blank" title="sitemap" href="/sitemap.xml">
                    sitemap
                </a>
            </div>
            <p class="copyright">版权所有  copyright 2017-2022  <a href="https://www.huju168.com/" title="虎居网上商城">四川蓝海农夫数字科技有限公司</a>   (400028521) </p><p class="copyright"><a class="beian" rel="nofollow" target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=51019002001684"><img th:src="@{/picture/58c94020eabf4431b9284ef49fd6bfa2.gif}" />&nbsp;<span>川公网安备 51019002001684号</span></a><span class="spacer"></span><a target="_blank" href="http://www.miibeian.gov.cn" rel="nofollow">网站备案/许可证号：蜀ICP备18008634号-1</a>                <span class="spacer"></span>                <a target="_blank" href="/edi.html" rel="nofollow">经营许可证：川B2-20180361</a>            </p>        </div>
    </div>
</div>

<script id="areasListTmp" type="text/html">
    <a class="site border">
        <span class="poitionCity"><%:=cityName%></span>
        <%if(data['common_areas'].length>0){%>
        <span class="org">[切换城市]</span>
        <%}%>
    </a>

    <%if(data['common_areas'].length>0){%>
    <div class="site-up dorpdown-layer hoverOpen">
        <div class="ui-areamini-content-wrap" id="ui-content-wrap">
            <%if(data['hot_areas'].length>0){%>
            <div class="hot">
                <%for(var i=0;i < data['hot_areas'].length;i++){%>
                <a rel="nofollow" href="/site/switch-city?city=<%:=data['hot_areas'][i]['name']%>&adcode=<%:=data['hot_areas'][i]['adcode']%>&loginUrl=<%:=loginUrl%>" <%if(data['hot_areas'][i]['name'] == cityName){%>style="background: #ff0000; color: #fff;"<%}%> ><%:=data['hot_areas'][i]['name']%></a>
                <%}%>
            </div>
            <%}%>

            <%if(data['common_areas'].length>0){%>
            <div class="search-first-letter">
                <a data-letter="A">A</a>
                <a data-letter="B">B</a>
                <a data-letter="C">C</a>
                <a data-letter="D">D</a>
                <a data-letter="E">E</a>
                <a data-letter="F">F</a>
                <a data-letter="G">G</a>
                <a data-letter="H">H</a>
                <a data-letter="J">J</a>
                <a data-letter="K">K</a>
                <a data-letter="L">L</a>
                <a data-letter="M">M</a>
                <a data-letter="N">N</a>
                <a data-letter="P">P</a>
                <a data-letter="Q">Q</a>
                <a data-letter="R">R</a>
                <a data-letter="S">S</a>
                <a data-letter="T">T</a>
                <a data-letter="W">W</a>
                <a data-letter="X">X</a>
                <a data-letter="Y">Y</a>
                <a data-letter="Z">Z</a>
            </div>

            <div class="scrollBody" id="scrollBody">
                <div class="all-list" id="scrollMap">
                    <ul id="ul">
                        <%for(var i=0;i < data['common_areas'].length;i++){%>
                        <li data-id="<%:=i+1%>" data-name="<%:=data['common_areas'][i]['initial']%>">
                            <em><%:=data['common_areas'][i]['initial']%></em>
                            <div class="itme-city">
                                <%if(data['common_areas'][i]['areass'].length>0){%>
                                <%for(var j=0;j < data['common_areas'][i]['areass'].length;j++){%>
                                <a rel="nofollow" href="/site/switch-city?city=<%:=data['common_areas'][i]['areass'][j]['name']%>&adcode=<%:=data['common_areas'][i]['areass'][j]['adcode']%>&loginUrl=<%:=loginUrl%>" class="<%if(data['common_areas'][i]['areass'][j]['name'] == cityName){%>city_selected<%}%>"><%:=data['common_areas'][i]['areass'][j]['name']%></a>
                                <%}%>
                                <%}%>
                            </div>
                        </li>
                        <%}%>
                    </ul>
                </div>
                <div class="scrollBar" id="scrollBar">
                    <p id="city_bar"></p>
                </div>
                <input name="area_phpName" type="hidden" id="phpName">
            </div>
            <%}%>
        </div>
    </div>
    <%}%>
</script>

<script th:src="@{/js/list.js}" 0="app\assets\AppAsset"></script>
<script th:src="@{/js/checkfunction.js}" 0="app\assets\AppAsset"></script>
<!--<script language="javascript" th:src="@{/js/lsjs.js}"></script>-->
<script type="text/javascript">
    $(function(){
        getAreasListFun();
//        $(".dorpdown-layer").jScroll();
    });

    /**
     * 城市切换数据
     * */
    function getAreasListFun()
    {
        $.ajax({
            url: '/site/get-areas-list',
            type: 'post',
            data: {
                _csrf: '0X16hkqCLihdUGz6qAsH4Bie-7si6zXFXhySJiwA-bijSzzMDOcZUGgDBYjYanTSbfu98mibW5IobMtjW1Ws4Q=='
            },
            dataType: 'json',
            success: function(json) {
                var cityName = '';
                cityName = cityName == '' && cityName1 ? cityName1 : cityName;
                var tpl = document.getElementById('areasListTmp').innerHTML;
                var html = template(tpl, {data: json['data'], cityName: cityName, loginUrl: 'https://www.huju168.com/category-14606176'});
                $('.top-site-up').html(html);

                if('goods/index' === 'store/exp-store' || 'goods/index' === 'experience/index') {
                    var tpl2 = document.getElementById('areasListBotTmp').innerHTML;
                    var html2 = template(tpl2, {data: json['data'], cityName: cityName, loginUrl: 'https://www.huju168.com/category-14606176'});
                    $('.bot-site-up').html(html2);
                }

                $(".dorpdown-layer").jScroll();
            },
            error: function(reg) {
                console.log(reg);
            }
        });
    }

    function openWin(obj) {

        var where_goods = "";
        if($(obj).attr('goods_id')){
            where_goods = '&goods_id=' + $(obj).attr('goods_id');
        }

        var where_seller = "";
        if($(obj).attr('ru_id')){
            where_seller = '&ru_id=' + $(obj).attr('ru_id');
        }

        if($(obj).attr('IM_type') != 'dsc'){
            var where = where_goods + where_seller;
        }else{
            var where = '';
        }
        var url='online.php?act=service' + where                   //转向网页的地址;
        var name='webcall';                         //网页名称，可为空;
        var iWidth=700;                          //弹出窗口的宽度;
        var iHeight=500;                         //弹出窗口的高度;
        //获得窗口的垂直位置
        var iTop = (window.screen.availHeight - 30 - iHeight) / 2;
        //获得窗口的水平位置
        var iLeft = (window.screen.availWidth - 10 - iWidth) / 2;
        window.open(url, name, 'height=' + iHeight + ',,innerHeight=' + iHeight + ',width=' + iWidth + ',innerWidth=' + iWidth + ',top=' + iTop + ',left=' + iLeft + ',status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=0,titlebar=no');
    }
</script>

<!-- 百度统计  -->
<script>
    var _hmt = _hmt || [];
    (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?ae46b3aea45eeb954b1d527fc7792211";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>

</body>
</html>
